package com.mes.cloud.dto;

import com.mes.cloud.annotation.ExcelAttribute;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 数据字典
 *
 * @author wxm
 * @Time 2019-4-16
 */
@ApiModel(value = "DictDTO", description = "数据字典信息")
@Data
public class DictDTO extends BaseDto implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @ApiModelProperty(value = "ID", dataType = "Long")
    @ExcelAttribute(name = "数据字典ID", column = "A")
    private Long id;
    /**
     * 数据库中存储的值
     */
    @ApiModelProperty(value = "字典代码", dataType = "Long")
    @ExcelAttribute(name = "字典代码", column = "B")
    @NotNull(message = "值不能为空！")
    private String value;
    /**
     * 名称
     */
    @ApiModelProperty(value = "名称", dataType = "Long")
    @ExcelAttribute(name = "名称", column = "C")
    @NotNull(message = "名称不能为空！")
    private String name;
    /**
     * 对象
     */
    @ApiModelProperty(value = "表名", dataType = "Long")
    @ExcelAttribute(name = "表名", column = "D")
    @NotNull(message = "表名不能为空！")
    private String object;
    /**
     * 字段
     */
    @ApiModelProperty(value = "字段名", dataType = "Long")
    @ExcelAttribute(name = "字段名", column = "E")
    @NotNull(message = "字段不能为空！")
    private String field;

    /**
     *
     */
    @ApiModelProperty(value = "创建时间", dataType = "Long")
    @ExcelAttribute(name = "创建时间", column = "F")
    private Date crtdate;

    /**
     *
     */
    @ApiModelProperty(value = "修改时间", dataType = "Long")
    @ExcelAttribute(name = "修改时间", column = "G")
    private Date upddate;
    /**
     * 描述
     */
    @ApiModelProperty(value = "描述", dataType = "Long")
    @ExcelAttribute(name = "描述", column = "H")
    private String remark;
    /**
     *
     */
    @ApiModelProperty(value = "删除", dataType = "Long")
    private Integer isDelete;
    /**
     *
     */
    @ApiModelProperty(value = "0-启用/1-禁用", dataType = "Long")
    @ExcelAttribute(name = "0-启用/1-禁用", column = "I")
    private Integer isEnable;

    @ApiModelProperty(value = "父节点", dataType = "Long")
    private Long parentId;

    @ApiModelProperty(value = "序号", dataType = "Long")
    @NotNull(message = "sort不能为空！")
    private Long sort;

    @ApiModelProperty(value = "是否默认 0-是/1-否", dataType = "Integer")
    private Integer isDefault;

    @ApiModelProperty(value = "类型", dataType = "String")
    private String type;

    @ApiModelProperty(value = "字段代码", dataType = "String")
    private String code;

    private List<DictDTO> children = new ArrayList<DictDTO>();
}